package com.yj.springbootevent.demo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MyAnnotationEventListener {


//    @EventListener(MyEvent.class)
    @EventListener
    public void eventListener(MyEvent myEvent){
        log.info("收到自定义事件MyEvent -- MyAnnotationEventListener");
        log.info("获取到的数据为：{}",myEvent.data);
    }


}
